package mapper.service;

import mapper.base.BaseService;
import mapper.dao.TestDao;
import mapper.entity.TestInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TestService extends BaseService<TestInfo> {
    @Autowired
    private TestDao testDao;

    public TestInfo findTestById(Integer id){
        return testDao.findTestById(id);
    }

    public List<TestInfo> findTestList() {
        return testDao.findTestList();
    }

    @Override
    public int insert(TestInfo entity) throws DataAccessException {
        return testDao.insert(entity);
    }

    @Override
    public int delete(Integer id) throws DataAccessException {
        return testDao.delete(id);
    }

    @Override
    public int update(TestInfo entity) throws DataAccessException {
        return testDao.update(entity);
    }

    @Override
    public int count() {
        return testDao.count();
    }

    @Override
    public List<TestInfo> query(String sql, Map<String, Object> params) throws DataAccessException {
        return testDao.query(sql, params);
    }
}
